package com.note.simpleshop.module.order.dao;
import com.note.simpleshop.entity.TbOrder;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

public interface OrderRepository extends JpaRepository<TbOrder, String>, JpaSpecificationExecutor<TbOrder> {
    @Transactional()
    @Modifying
    @Query("update TbOrder  set stock = ?1 where order_no=?2")
    void updateOrderStatus(Integer orderStatus,String orderNo);
}
